Close check_delimiters.py gap: catch parens split across echo lines - #409
Merged
mixmansoundude merged 1 commit intoAug 1, 2026
Merged
Conversation
Today's regression (unbalanced parens across two echo lines inside an if-block, PR #408 commit fd52a3f) passed check_delimiters.py clean because a stray (...) pair inside echo text is individually balanced from a whole-file LIFO paren-count perspective -- the hazard is specifically about a cross-line split landing inside an already-open enclosing block, not a raw count mismatch. check_delimiters.py now tracks, for .bat/.cmd files, whether a '(' opened on an echo line while already nested inside another open bracket, and flags it if the matching ')' closes on a different line. Scoped to "already nested" so a harmless top-level echo statement with no enclosing block (a real instance exists in run_setup.bat, :print_fastpath_ambiguous_note) doesn't false-positive. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A4iE1BRSkUETwz237XeuTW
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesNested echo delimiter detection
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant BatchFile
participant DelimiterChecker
participant DelimiterStack
participant IssueReporter
BatchFile->>DelimiterChecker: provide echo and delimiter lines
DelimiterChecker->>DelimiterStack: push nested echo parenthesis metadata
DelimiterChecker->>DelimiterStack: pop later closing parenthesis
DelimiterChecker->>IssueReporter: report delayed nested echo closure
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
mixmansoundude
enabled auto-merge (squash)
August 1, 2026 04:51
mixmansoundude
deleted the
claude/bootstrapper-execution-branches-ox2izi
branch
August 1, 2026 04:51
mixmansoundude
temporarily deployed
to
github-pages
August 1, 2026 06:23 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to PR #408, which shipped a real batch-syntax regression: a
(opened on oneecholine and its matching)closed on the nextecholine, both inside a parenthesizedifblock. cmd.exe's block parser counts parens inechotext too, so the stray closing paren prematurely ended the block and broke 6 CI lanes simultaneously (failed was unexpected at this time.) -- caught only by real CI, not by any local check, becausecheck_delimiters.py's paren-balance logic is a whole-file LIFO scan: a stray(...)pair inside echo text is individually balanced, so it never trips the existing unclosed/mismatched detection.This PR closes that gap:
tools/check_delimiters.pynow tracks, for.bat/.cmdfiles, whether a(was opened on anecholine while already nested inside another open bracket (a real enclosingif/forblock). If its matching)closes on a different source line, it's flagged.echostatement with no enclosing block has no block-closing search for cmd.exe to corrupt, so flagging it would be a false positive. A real, harmless instance of exactly this shape already exists inrun_setup.bat(:print_fastpath_ambiguous_note) and is used as the negative test case.docs/agent-lessons-learned.md's existing entry on this hazard (added in PR fix: backlog items 8, 14, 19 -- UNC WARN, misleading syntax error, cache-lane trap #408) is updated to say the gap is now closed, instead of describing it as an open limitation.Test plan
python tools/check_delimiters.py run_setup.bat-- clean (no false positives on the real file)python tools/check_delimiters.py run(full repo sweep, all supported file types) -- cleantests/test_check_delimiters_import.py: flags a paren split across echo lines inside a realifblock; does NOT flag the same textual pattern at top level (no enclosing block); does NOT flag a balanced same-line pair.batfile and confirmed the new check catches ittools/run_sanity_sweep.sh): compileall, pyflakes, delimiter check, markdownlint, yamllint, actionlint, ASCII sweep, PowerShell AST parse sweep, pytest (461 passed, 2 skipped) -- all clean🤖 Generated with Claude Code
Generated by Claude Code